// source --> https://floresfarm.com/wp-content/plugins/responsive-lightbox/js/front.js?ver=2.3.2 ( function( $ ) { // parse query string var parse_str = function( name, str ) { var regex = new RegExp( '[?&]' + name.replace( /[\[\]]/g, '\\$&' ) + '(=([^&#]*)|&|#|$)' ); var results = regex.exec( '&' + str ); return ( ! results || ! results[2] ? '' : decodeURIComponent( results[2].replace( /\+/g, ' ' ) ) ); } // observe DOM changes var observe_script_dom = ( function() { var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; var eventListenerSupported = window.addEventListener; return function( obj, only_added, callback ) { if ( MutationObserver ) { // define a new observer var obs = new MutationObserver( function( mutations, observer ) { if ( only_added ) { if ( mutations[0].addedNodes.length ) callback(); } else { if ( mutations[0].addedNodes.length || mutations[0].removedNodes.length ) callback(); } } ); // have the observer observe for changes in children obs.observe( obj, { childList: true, subtree: true } ); } else if ( eventListenerSupported ) { obj.addEventListener( 'DOMNodeInserted', callback, false ); if ( !only_added ) obj.addEventListener( 'DOMNodeRemoved', callback, false ); } } } )(); // ready event $( function() { init_rl(); } ); // custom events trigger $( document ).on( rlArgs.customEvents, function() { init_rl(); } ); function init_rl() { var containers = []; // check for infinite galleries $( '.rl-gallery-container' ).each( function() { var container = $( this ); // is it ifinite scroll gallery? if ( container.hasClass( 'rl-pagination-infinite' ) ) containers.push( container ); // remove loading class else container.removeClass( 'rl-loading' ); } ); // any infinite galleries? if ( containers.length > 0 ) { for ( var i = 0; i < containers.length; i++ ) { var container = containers[i]; var gallery = container.find( '.rl-gallery' ); var gallery_id = parseInt( container.data( 'gallery_id' ) ); var gallery_scroll_type = container.find( '.rl-pagination-bottom' ).data( 'button' ); var gallery_button = typeof gallery_scroll_type !== 'undefined' && gallery_scroll_type === 'manually'; // initialize infinite scroll gallery.infiniteScroll( { path: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-pagination-bottom .next', append: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-gallery-item' + ( gallery.hasClass( 'rl-masonry-gallery' ) || gallery.hasClass( 'rl-basicmasonry-gallery' ) ? '-no-append' : '' ), status: false, hideNav: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-pagination-bottom', prefill: ! gallery_button, loadOnScroll: true, scrollThreshold: gallery_button ? false : 0, button: gallery_button ? '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-load-more' : false, debug: false, history: false, onInit: function() { // infinite with button? if ( container.hasClass( 'rl-pagination-infinite' ) && gallery_button ) { // remove loading class container.removeClass( 'rl-loading' ); } // store gallery ID for append event var _gallery_id = gallery_id; // request event this.on( 'request', function( path ) { // add loading class container.addClass( 'rl-loading' ); } ); // append event this.on( 'append', function( response, path, items ) { // remove loading class container.removeClass( 'rl-loading' ); $.event.trigger( { type: 'doResponsiveLightbox', script: rlArgs.script, selector: rlArgs.selector, args: rlArgs, pagination_type: 'infinite', gallery_id: _gallery_id, masonry: gallery.hasClass( 'rl-masonry-gallery' ) || gallery.hasClass( 'rl-basicmasonry-gallery' ), infinite: { gallery: gallery, response: response, items: items } } ); } ); } } ); } } // initialize event $.event.trigger( { type: 'doResponsiveLightbox', script: rlArgs.script, selector: rlArgs.selector, args: rlArgs } ); } // pagination $( document ).on( 'click', '.rl-pagination a.page-numbers', function( e ) { var link = $( this ); var container = link.closest( '.rl-gallery-container' ); // ajax type pagination? if ( container.hasClass( 'rl-pagination-ajax' ) ) { e.preventDefault(); e.stopPropagation(); var gallery_id = container.data( 'gallery_id' ); // add loading class container.addClass( 'rl-loading' ); $.post( rlArgs.ajaxurl, { action: 'rl-get-gallery-page-content', gallery_id: gallery_id, page: parse_str( 'rl_page', link.prop( 'href' ) ), nonce: rlArgs.nonce } ).done( function( response ) { // replace container with new content container.replaceWith( $( response ).removeClass( 'rl-loading' ) ); // trigger main event $.event.trigger( { type: 'doResponsiveLightbox', script: rlArgs.script, selector: rlArgs.selector, args: rlArgs, pagination_type: 'ajax', gallery_id: gallery_id } ); } ).fail( function() { container.removeClass( 'rl-loading' ); } ); return false; } } ); // this is similar to the WP function add_action(); $( document ).on( 'doResponsiveLightbox', function( event ) { if ( typeof event.masonry !== 'undefined' && event.masonry === true ) return false; var script = event.script; var selector = event.selector; var args = event.args; if ( typeof script === 'undefined' || typeof selector === 'undefined' ) return false; rl_view_image = function( script, url ) { $.event.trigger( { type: 'doLightboxViewImage', script: script, url: url } ); } rl_hide_image = function( script, url ) { $.event.trigger( { type: 'doLightboxHideImage', script: script, url: url } ); } // WooCommerce 3.0+ compatibility setTimeout( function() { var flex = $( '.flex-viewport' ); if ( args.woocommerce_gallery === '1' ) { var gallery = $( '.woocommerce-product-gallery' ); if ( gallery.find( '.woocommerce-product-gallery__trigger' ).length === 0 ) { gallery.prepend( '🔍' ); gallery.on( 'click', '.woocommerce-product-gallery__trigger', function( e ) { e.preventDefault(); e.stopPropagation(); if ( flex.length ) flex.find( '.flex-active-slide a[data-rel]' ).trigger( 'click' ); else gallery.find( 'a[data-rel]' ).first().trigger( 'click' ); } ); } } }, 10 ); // init lightbox switch ( script ) { case 'swipebox': var slide = $( '#swipebox-overlay' ).find( '.slide.current' ); var image_source = ''; var allow_hide = false; var close_executed = false; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).swipebox( { useCSS: ( args.animation === '1' ? true : false ), useSVG: ( args.useSVG === '1' ? true : false ), hideCloseButtonOnMobile: ( args.hideCloseButtonOnMobile === '1' ? true : false ), removeBarsOnMobile: ( args.removeBarsOnMobile === '1' ? true : false ), hideBarsDelay: ( args.hideBars === '1' ? parseInt( args.hideBarsDelay ) : 0 ), videoMaxWidth: parseInt( args.videoMaxWidth ), loopAtEnd: ( args.loopAtEnd === '1' ? true : false ), afterOpen: function() { close_executed = false; // update current slide container slide = $( '#swipebox-overlay' ).find( '.slide.current' ); // get image source var image = slide.find( 'img' ).attr( 'src' ); // valid image source? if ( typeof image !== 'undefined' ) { image_source = image; // trigger image view rl_view_image( script, image_source ); } else { image_source = ''; } // add current slide observer observe_script_dom( document.getElementById( 'swipebox-slider' ), false, function() { if ( image_source === '' ) { // get image source var image = slide.find( 'img' ).attr( 'src' ); // valid image source? if ( typeof image !== 'undefined' ) { image_source = image; // trigger image view rl_view_image( script, image_source ); } else { image_source = ''; } } } ); }, nextSlide: function() { // update current slide container slide = $( '#swipebox-overlay' ).find( '.slide.current' ); // get image source var image = slide.find( 'img' ).attr( 'src' ); // valid image source? if ( typeof image !== 'undefined' ) { image_source = image; // trigger image view rl_view_image( script, image_source ); } else { image_source = ''; } }, prevSlide: function() { // update current slide container slide = $( '#swipebox-overlay' ).find( '.slide.current' ); // get image source var image = slide.find( 'img' ).attr( 'src' ); // valid image source? if ( typeof image !== 'undefined' ) { image_source = image; // trigger image view rl_view_image( script, image_source ); } else { image_source = ''; } }, afterClose: function() { // afterClose event executed close_executed = true; // allow to hide image? if ( allow_hide ) { // trigger image hide rl_hide_image( script, image_source ); allow_hide = false; } } } ); // additional event to prevent rl_hide_image to execure while opening modal $( window ).on( 'resize', function() { if ( ! close_executed ) { allow_hide = true; } } ); break; case 'prettyphoto': var view_disabled = false; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function() { var el = $( this ); // set description el.attr( 'title', el.data( 'rl_caption' ) ); // set title el.find( 'img' ).attr( 'alt', el.data( 'rl_title' ) ); } ); $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).prettyPhoto( { hook: 'data-rel', animation_speed: args.animationSpeed, slideshow: ( args.slideshow === '1' ? parseInt( args.slideshowDelay ) : false ), autoplay_slideshow: ( args.slideshowAutoplay === '1' ? true : false ), opacity: args.opacity, show_title: ( args.showTitle === '1' ? true : false ), allow_resize: ( args.allowResize === '1' ? true : false ), allow_expand: ( args.allowExpand === '1' ? true : false ), default_width: parseInt( args.width ), default_height: parseInt( args.height ), counter_separator_label: args.separator, theme: args.theme, horizontal_padding: parseInt( args.horizontalPadding ), hideflash: ( args.hideFlash === '1' ? true : false ), wmode: args.wmode, autoplay: ( args.videoAutoplay === '1' ? true : false ), modal: ( args.modal === '1' ? true : false ), deeplinking: ( args.deeplinking === '1' ? true : false ), overlay_gallery: ( args.overlayGallery === '1' ? true : false ), keyboard_shortcuts: ( args.keyboardShortcuts === '1' ? true : false ), social_tools: ( args.social === '1' ? '
' : '' ), ie6_fallback: true, changepicturecallback: function() { // is view disabled? if ( view_disabled ) { // enable view view_disabled = false; return; } last_image = $( '#pp_full_res' ).find( 'img' ).attr( 'src' ); // trigger image view rl_view_image( script, last_image ); // is expanding allowed? if ( args.allowExpand === '1' ) { // disable changepicturecallback event after expanding $( 'a.pp_expand' ).on( 'click', function() { view_disabled = true; } ); } }, callback: function() { // trigger image hide rl_hide_image( script, last_image ); } } ); break; case 'fancybox': var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).fancybox( { modal: ( args.modal === '1' ? true : false ), overlayShow: ( args.showOverlay === '1' ? true : false ), showCloseButton: ( args.showCloseButton === '1' ? true : false ), enableEscapeButton: ( args.enableEscapeButton === '1' ? true : false ), hideOnOverlayClick: ( args.hideOnOverlayClick === '1' ? true : false ), hideOnContentClick: ( args.hideOnContentClick === '1' ? true : false ), cyclic: ( args.cyclic === '1' ? true : false ), showNavArrows: ( args.showNavArrows === '1' ? true : false ), autoScale: ( args.autoScale === '1' ? true : false ), scrolling: args.scrolling, centerOnScroll: ( args.centerOnScroll === '1' ? true : false ), opacity: ( args.opacity === '1' ? true : false ), overlayOpacity: parseFloat( args.overlayOpacity / 100 ), overlayColor: args.overlayColor, titleShow: ( args.titleShow === '1' ? true : false ), titlePosition: args.titlePosition, transitionIn: args.transitions, transitionOut: args.transitions, easingIn: args.easings, easingOut: args.easings, speedIn: parseInt( args.speeds ), speedOut: parseInt( args.speeds ), changeSpeed: parseInt( args.changeSpeed ), changeFade: parseInt( args.changeFade ), padding: parseInt( args.padding ), margin: parseInt( args.margin ), width: parseInt( args.videoWidth ), height: parseInt( args.videoHeight ), onComplete: function() { last_image = $( '#fancybox-content' ).find( 'img' ).attr( 'src' ); // trigger image view rl_view_image( script, last_image ); }, onClosed: function() { // trigger image hide rl_hide_image( script, last_image ); } } ); break; case 'nivo': $.each( $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ), function() { var attr = $( this ).attr( 'data-rel' ); // check data-rel attribute first if ( typeof attr === 'undefined' || attr == false ) { // if not found then try to check rel attribute for backward compatibility attr = $( this ).attr( 'rel' ); } // for some browsers, `attr` is undefined; for others, `attr` is false. Check for both. if ( typeof attr !== 'undefined' && attr !== false ) { var match = attr.match( new RegExp( selector + '\\-(gallery\\-(?:[\\da-z]{1,4}))', 'ig' ) ); if ( match !== null ) $( this ).attr( 'data-lightbox-gallery', match[0] ); } } ); var observer_initialized = false; var change_allowed = true; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).nivoLightbox( { effect: args.effect, clickOverlayToClose: ( args.clickOverlayToClose === '1' ? true : false ), keyboardNav: ( args.keyboardNav === '1' ? true : false ), errorMessage: args.errorMessage, afterShowLightbox: function( lightbox ) { var content = $( lightbox )[0].find( '.nivo-lightbox-content' ); // is observer initialized? if ( !observer_initialized ) { // turn it off observer_initialized = true; // add content observer observe_script_dom( document.getElementsByClassName( 'nivo-lightbox-content' )[0], true, function() { if ( change_allowed ) { last_image = content.find( '.nivo-lightbox-image img' ).attr( 'src' ); // trigger image view rl_view_image( script, last_image ); // disallow observer changes change_allowed = false; } } ); } }, afterHideLightbox: function() { // allow observer changes change_allowed = true; // trigger image hide rl_hide_image( script, last_image ); }, onPrev: function( element ) { // disallow observer changes change_allowed = false; last_image = element[0].attr( 'href' ); // trigger image view rl_view_image( script, last_image ); }, onNext: function( element ) { // disallow observer changes change_allowed = false; last_image = element[0].attr( 'href' ); // trigger image view rl_view_image( script, last_image ); } } ); break; case 'imagelightbox': var selectors = []; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function( i, item ) { var attr = $( item ).attr( 'data-rel' ); // check data-rel attribute first if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); // if not found then try to check rel attribute for backward compatibility else { attr = $( item ).attr( 'rel' ); if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); } } ); if ( selectors.length > 0 ) { // make unique selectors = _.uniq( selectors ); $( selectors ).each( function( i, item ) { if ( typeof event.pagination_type !== 'undefined' ) { $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() { $( this ).off( 'click.imageLightbox' ); } ); } $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).imageLightbox( { animationSpeed: parseInt( args.animationSpeed ), preloadNext: ( args.preloadNext === '1' ? true : false ), enableKeyboard: ( args.enableKeyboard === '1' ? true : false ), quitOnEnd: ( args.quitOnEnd === '1' ? true : false ), quitOnImgClick: ( args.quitOnImageClick === '1' ? true : false ), quitOnDocClick: ( args.quitOnDocumentClick === '1' ? true : false ), onLoadEnd: function() { last_image = $( '#imagelightbox' ).attr( 'src' ); // trigger image view rl_view_image( script, last_image ); }, onEnd: function() { // trigger image hide rl_hide_image( script, last_image ); } } ); } ); } break; case 'tosrus': var selectors = []; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function( i, item ) { var attr = $( item ).attr( 'data-rel' ); // check data-rel attribute first if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); // if not found then try to check rel attribute for backward compatibility else { attr = $( item ).attr( 'rel' ); if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); } } ); if ( selectors.length > 0 ) { // make unique selectors = _.uniq( selectors ); $( selectors ).each( function( i, item ) { if ( typeof event.pagination_type !== 'undefined' ) { $( 'body' ).find( '.tosrus-' + item ).remove(); $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() { $( this ).off( 'click.tos' ); } ); } var tos = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).tosrus( { infinite: ( args.infinite === '1' ? true : false ), autoplay: { play: ( args.autoplay === '1' ? true : false ), pauseOnHover: ( args.pauseOnHover === '1' ? true : false ), timeout: args.timeout }, effect: args.effect, keys: { prev: ( args.keys === '1' ? true : false ), next: ( args.keys === '1' ? true : false ), close: ( args.keys === '1' ? true : false ) }, pagination: { add: ( args.pagination === '1' ? true : false ), type: args.paginationType }, // forced show: false, buttons: true, caption: { add: true, attributes: [ "title" ] }, wrapper: { classes: 'tosrus-' + item, onClick: args.closeOnClick === '1' ? 'close' : 'toggleUI' } } ); tos.on( 'sliding.tos', function( event, number ) { last_image = $( $( event.target ).find( '.tos-slider .tos-slide' )[number] ).find( 'img' ).attr( 'src' ); // trigger image view rl_view_image( script, last_image ); } ); tos.on( 'closing.tos', function() { // trigger image hide rl_hide_image( script, last_image ); } ); } ); } break; case 'featherlight': var selectors = []; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function( i, item ) { var attr = $( item ).attr( 'data-rel' ); // check data-rel attribute first if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); // if not found then try to check rel attribute for backward compatibility else { attr = $( item ).attr( 'rel' ); if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); } } ); if ( selectors.length > 0 ) { // make unique selectors = _.uniq( selectors ); // set defaults $.extend( $.featherlight.defaults, { openSpeed: parseInt( args.openSpeed ), closeSpeed: parseInt( args.closeSpeed ), closeOnClick: args.closeOnClick, closeOnEsc: ( args.closeOnEsc === '1' ? true : false ), afterOpen: function( event ) { last_image = event.currentTarget.href; // trigger image view rl_view_image( script, last_image ); }, afterClose: function() { // trigger image hide rl_hide_image( script, last_image ); } } ); $( selectors ).each( function( i, item ) { if ( typeof event.pagination_type !== 'undefined' ) { $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() { $( this ).off( 'click.featherlight' ); } ); } // gallery? if ( /-gallery-/.test( item ) ) { $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlightGallery( { galleryFadeIn: parseInt( args.galleryFadeIn ), galleryFadeOut: parseInt( args.galleryFadeOut ), previousIcon: '❮', nextIcon: '❯' } ); // video? } else if ( /-video-/.test( item ) ) { $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight(); // single image? } else { $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight(); } } ); } break; case 'magnific': var selectors = []; var last_image = ''; $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function( i, item ) { var attr = $( item ).attr( 'data-rel' ); // check data-rel attribute first if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); // if not found then try to check rel attribute for backward compatibility else { attr = $( item ).attr( 'rel' ); if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' ) selectors.push( attr ); } } ); if ( selectors.length > 0 ) { // make unique selectors = _.uniq( selectors ); $( selectors ).each( function( i, item ) { var subselector = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ); var element = $( subselector[0] ); var media_type = element.data( 'magnific_type' ); var content_type = element.data( 'rl_content' ); // check content type first if ( typeof content_type !== 'undefined' ) media_type = content_type; // then media type if needed if ( typeof media_type === 'undefined' ) media_type = 'image'; subselector.magnificPopup( { type: media_type === 'gallery' ? 'image' : ( media_type === 'video' ? 'iframe' : media_type ), disableOn: args.disableOn, midClick: args.midClick === '1', preloader: args.preloader === '1', closeOnContentClick: args.closeOnContentClick === '1', closeOnBgClick: args.closeOnBgClick === '1', closeBtnInside: args.closeBtnInside === '1', showCloseBtn: args.showCloseBtn === '1', enableEscapeKey: args.enableEscapeKey === '1', alignTop: args.alignTop === '1', autoFocusLast: args.autoFocusLast === '1', fixedContentPos: args.fixedContentPos === 'auto' ? 'auto' : ( args.fixedContentPos === '1' ), fixedBgPos: args.fixedBgPos === 'auto' ? 'auto' : ( args.fixedBgPos === '1' ), image: { titleSrc: function( item ) { return item.el.attr( 'data-rl_title' ) + '' + item.el.attr( 'data-rl_caption' ) + ''; } }, gallery: { enabled: subselector.length > 1 && media_type === 'gallery', navigateByImgClick: true, preload: [0,1] }, callbacks: { close: function() { rl_hide_image( script, this.currItem.src ); }, imageLoadComplete: function() { // trigger image view rl_view_image( script, this.currItem.src ); } } } ); } ); } break; } } ); } )( jQuery ); // source --> https://floresfarm.com/wp-content/plugins/wonderplugin-lightbox-trial/engine/wonderpluginlightbox.js?ver=9.6 /** Wonderplugin Lightbox Plugin Trial Version * Copyright 2022 Magic Hills Pty Ltd All Rights Reserved * Website: http://www.wonderplugin.com * Version 9.6 */ (function(){var scripts=document.getElementsByTagName("script");var jsFolder="";for(var i=0;i0&&inst.options.skinsfolder[inst.options.skinsfolder.length-1]!="/")inst.options.skinsfolder+="/";if(inst.options.skinsfolder.charAt(0)!="/"&&inst.options.skinsfolder.substring(0,5)!="http:"&&inst.options.skinsfolder.substring(0,6)!="https:")inst.options.skinsfolder= inst.options.jsfolder+inst.options.skinsfolder;var image_list=["loadingimage","nextimage","previmage","closeimage","playvideoimage","titlebgimage","navarrowsprevimage","navarrowsnextimage","navcontrolimage","playimage","pauseimage","fullscreencloseimage","fullscreennextimage","fullscreenprevimage"];for(var i=0;i=2?parseInt(match[1],10):0}if(inst.options.isAndroid){var match=navigator.userAgent.match(/Android\s([0-9\.]*)/i);inst.options.androidVersion=match&&match.length>=2?parseInt(match[1],10):-1}var v=document.createElement("video");inst.options.canplaymp4=v&&v.canPlayType&&v.canPlayType("video/mp4").replace(/no/,"");if(inst.options.isFirefox&&inst.options.nativecontrolsonfirefox|| (inst.options.isIE6789||inst.options.isIE10||inst.options.isIE11)&&inst.options.nativecontrolsonie||inst.options.isIPhone&&inst.options.nativecontrolsoniphone||inst.options.isIPad&&inst.options.nativecontrolsonipad||inst.options.isAndroid&&inst.options.nativecontrolsonandroid)inst.options.nativehtml5controls=true;if(inst.options.isIOS||inst.options.isAndroid)inst.options.nativecontrolsonfullscreen=true;inst.options.navheight=0;inst.options.thumbgap+=2*inst.options.thumbborder;inst.options.resizeTimeout= -1;inst.slideTimeout=null;inst.autosliding=false;inst.existingElem=-1;inst.direction=-3;inst.elemArray=new Array;inst.options.curElem=-1;inst.defaultoptions=$.extend({},inst.options);if(inst.options.googleanalyticsaccount&&!window._gaq){window._gaq=window._gaq||[];window._gaq.push(["_setAccount",inst.options.googleanalyticsaccount]);window._gaq.push(["_trackPageview"]);$.getScript("https://ssl.google-analytics.com/ga.js")}if(inst.options.initvimeo){var tag=document.createElement("script");tag.src= inst.options.jsfolder+"froogaloop2.min.js";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}if(inst.options.inityoutube){var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}if(inst.options.initsocial)$("head").append(''); inst.showing=false;inst.navvisible=false;inst.disableKeyOutsideOfLightbox=function(event){if($(event.target).closest("#html5box-html5-lightbox").length<=0){event.preventDefault();$("#html5-lightbox-box .html5-elem-box").attr("tabindex","-1").focus()}};if(inst.options.limitfocus){$(window).on("html5lightbox.lightboxopened",function(){$(document).on("keydown",inst.disableKeyOutsideOfLightbox);$("#html5-lightbox-box .html5-elem-box").attr("tabindex","-1").focus()});$(window).on("html5lightbox.lightboxclosed", function(){$(document).off("keydown",inst.disableKeyOutsideOfLightbox)})}inst.disableEscKey=function(isFullscreen){if(isFullscreen)inst.disableesckeyinfullscreen=true;else setTimeout(function(){inst.disableesckeyinfullscreen=false},1E3)};inst.supportKeyboard=function(){inst.disableesckeyinfullscreen=false;$(document).keyup(function(e){if(!inst.showing)return;if(!inst.disableesckeyinfullscreen&&inst.options.supportesckey&&e.keyCode==27)inst.finish();else if(inst.options.supportarrowkeys)if(e.keyCode== 39)inst.gotoSlide(-1);else if(e.keyCode==37)inst.gotoSlide(-2)});if(inst.options.supportesckey&&document.addEventListener){document.addEventListener("MSFullscreenChange",function(){inst.disableEscKey(document.msFullscreenElement!=null)},false);document.addEventListener("webkitfullscreenchange",function(){inst.disableEscKey(document.webkitIsFullScreen)},false)}};inst.supportKeyboard();inst.init=function(){inst.showing=false;inst.readData();inst.createMarkup();inst.initSlide()};inst.checkParentData= function(node,parentNode,attr){return node.data(attr)?node.data(attr):parentNode&&parentNode.data(attr)?parentNode.data(attr):null};inst.checkParentClass=function(node,parentNode,attr){var ret=null;$.each([node,parentNode],function(index,nodeValue){if(nodeValue&&nodeValue.attr("class")){var classList=nodeValue.attr("class").split(/\s+/);$.each(classList,function(index,className){if(className&&className.toLowerCase().indexOf("wplightbox-"+attr+"-")==0){var names=className.split("-");if(names.length== 3){var val=names[2];if(val.toLowerCase()=="true")val=true;else if(val.toLowerCase()=="false")val=false;else if(/^\d+$/.test(val))val=parseInt(val);else if(!isNaN(val))val=parseFloat(val);ret=val}}})}});return ret};inst.readNodeData=function(node,parentNode){var fileType="mediatype"in node.data()?node.data("mediatype"):inst.checkType(node.attr("href"));if(fileType<0)return;var title=node.data("title")?node.data("title"):node.attr("title");if(!title&&node.find("img").length>0){var img=node.find("img"); title=img.attr("title")?img.attr("title"):img.attr("alt")?img.attr("alt"):""}var group=node.data("group")?node.data("group"):inst.options.userelforgroup?node.attr("rel"):null;if(!group&&parentNode)group=parentNode.data("group")?parentNode.data("group"):inst.options.userelforgroup?parentNode.attr("rel"):null;for(var i=0;i0){if(container.find(".lightboxtitle").length>0)newItem[ELEM_TITLE]=container.find(".lightboxtitle").text();if(container.find(".lightboxdescription").length> 0)newItem[ELEM_DESCRIPTION]=container.find(".lightboxdescription").text()}inst.elemArray.push(newItem)};inst.readData=function(){inst.each(function(){var self=$(this);if(this.nodeName.toLowerCase()=="a"||this.nodeName.toLowerCase()=="area")inst.readNodeData(self);else self.find("a,area").each(function(){inst.readNodeData($(this),self)})})};inst.createMarkup=function(){if($(window).width()<=inst.options.fullscreensmallscreenwidth){if(inst.options.fullscreenmodeonsmallscreen){inst.options.fullscreenmode= true;if(inst.options.fullscreennomarginonsmallscreen)inst.options.fullscreennomargin=true}if(inst.options.fullscreenmode&&inst.options.fullscreennomarginonsmallscreen)inst.options.fullscreennomargin=true}if(inst.options.fullscreenmode){inst.options.bgcolor=inst.options.fullscreenbgcolor;inst.options.bordersize=inst.options.fullscreenbordersize;inst.options.loadingfontcolor=inst.options.fullscreenloadingfontcolor;if(inst.options.fullscreennomargin){inst.options.bordersize=0;inst.options.bordermargin= 0;inst.options.bordertopmargin=0;inst.options.bordertopmarginsmall=0}if(inst.options.fullscreentextoutside){inst.options.titlestyle="outside";inst.options.titlecss=inst.options.titleoutsidecss;inst.options.descriptioncss=inst.options.descriptionoutsidecss}else if(inst.options.fullscreentextinside){inst.options.titlestyle="inside";inst.options.titlecss=inst.options.titleinsidecss;inst.options.descriptioncss=inst.options.descriptioninsidecss}else{inst.options.titlebottomcss=inst.options.fullscreentitlebottomcss; inst.options.descriptionbottomcss=inst.options.fullscreendescriptionbottomcss}}inst.options.barheightoriginal=inst.options.barheight;if(inst.options.responsivebarheight){var winH=inst.getWinH();if(winH<=inst.options.smallscreenheight)inst.options.barheight=inst.options.barheightonsmallheight}switch(inst.options.titlestyle){case "inside":inst.options.titlecss=inst.options.titleinsidecss;inst.options.descriptioncss=inst.options.descriptioninsidecss;break;case "outside":inst.options.titlecss=inst.options.titleoutsidecss; inst.options.descriptioncss=inst.options.descriptionoutsidecss;break;default:inst.options.titlecss=inst.options.titlebottomcss;inst.options.descriptioncss=inst.options.descriptionbottomcss}inst.options.titlecss=$.trim(inst.options.titlecss);if(inst.options.titlecss.length>1){if(inst.options.titlecss.charAt(0)=="{")inst.options.titlecss=inst.options.titlecss.substring(1);if(inst.options.titlecss.charAt(inst.options.titlecss.length-1)=="}")inst.options.titlecss=inst.options.titlecss.substring(0,inst.options.titlecss.length- 1)}inst.options.descriptioncss=$.trim(inst.options.descriptioncss);if(inst.options.descriptioncss.length>1){if(inst.options.descriptioncss.charAt(0)=="{")inst.options.descriptioncss=inst.options.descriptioncss.substring(1);if(inst.options.descriptioncss.charAt(inst.options.descriptioncss.length-1)=="}")inst.options.descriptioncss=inst.options.descriptioncss.substring(0,inst.options.descriptioncss.length-1)}inst.options.errorcss=$.trim(inst.options.errorcss);if(inst.options.errorcss.length>1){if(inst.options.errorcss.charAt(0)== "{")inst.options.errorcss=inst.options.errorcss.substring(1);if(inst.options.errorcss.charAt(inst.options.errorcss.length-1)=="}")inst.options.errorcss=inst.options.errorcss.substring(0,inst.options.errorcss.length-1)}var styleCss=" .bodynoscroll {height:100%;overflow:hidden;}";styleCss+=" #html5box-html5-lightbox .html5-text {"+inst.options.titlecss+"}";styleCss+=" #html5box-html5-lightbox .html5-description {"+inst.options.descriptioncss+"}";styleCss+=" #html5box-html5-lightbox .html5-error {"+ inst.options.errorcss+"}";styleCss+=" .html5-prev-fullscreen {display:block;cursor:pointer;position:absolute;z-index:1;left:"+inst.options.bordersize+"px;right:auto;top:50%;transform:translate(0,-50%)} .html5-next-fullscreen {display:block;cursor:pointer;position:absolute;z-index:1;left:auto;right:"+inst.options.bordersize+"px;top:50%;transform:translate(0,-50%)}";styleCss+=" .html5-prev, .html5-next {display:none;cursor:pointer;position:absolute;z-index:1;}";styleCss+=" .html5-prev-inside {left:"+ inst.options.bordersize+"px;right:auto;top:50%;transform:translate(0,-50%)} .html5-next-inside {left:auto;right:"+inst.options.bordersize+"px;top:50%;transform:translate(0,-50%)}";styleCss+=" .html5-prev-outside {left:0;right:auto;top:50%;transform:translate(-100%,-50%);} .html5-next-outside {left:auto;right:0;top:50%;transform:translate(100%,-50%);}";if(inst.options.showarrowsbottomonsmallscreen){styleCss+="@media (max-width: "+inst.options.navarrowsbottomscreenwidth+"px) {";if(inst.options.outsidearrowspos== "bottom")styleCss+=" .html5-prev-outside {display:block;top:100%;left:0;right:auto;transform:none;} .html5-next-outside {display:block;top:100%;left:auto;right:0;transform:none;}";else if(inst.options.outsidearrowspos=="bottominside")styleCss+=" .html5-prev-outside {display:block;top:100%;left:0;right:auto;transform:translate(0,-100%);} .html5-next-outside {display:block;top:100%;left:auto;right:0;transform:translate(0,-100%);}";else styleCss+=" .html5-prev-outside {display:block;top:50%;left:0;right:auto;transform:translate(0,-50%);} .html5-next-outside {display:block;top:50%;left:auto;right:0;transform:translate(0,-50%);}"; styleCss+=" .html5-prev-fullscreen {display:none;} .html5-next-fullscreen {display:none;}";styleCss+="}"}styleCss+=" .html5-prev-inside .mh-icon-left, .html5-next-inside .mh-icon-right { display:table-cell; vertical-align:middle; font-size: 20px; color: #ddd; background-color: rgba(0,0,0,0.6); line-height: 36px; width: 36px; height: 36px; text-align: center;} .html5-prev-inside .mh-icon-left:hover, .html5-next-inside .mh-icon-right:hover { color: #fff; } .html5-prev-outside .mh-icon-left, .html5-next-outside .mh-icon-right, .html5-prev-fullscreen .mh-icon-left, .html5-next-fullscreen .mh-icon-right { display:table-cell; vertical-align:middle; font-size: 24px; line-height: 36px; color: #ccc; background-color: rgba(0,0,0,0.6); } .html5-prev-outside .mh-icon-left:hover, .html5-next-outside .mh-icon-right:hover, .html5-prev-fullscreen .mh-icon-left:hover, .html5-next-fullscreen .mh-icon-right:hover { color: #fff; }"; if(inst.options.titlestyle=="right"){styleCss+="#html5box-html5-lightbox .html5-elem-wrap {width:"+inst.options.imagepercentage+"%;height:100%;} #html5box-html5-lightbox .html5-elem-data-box {min-height:100%;}";styleCss+="@media (max-width: "+inst.options.sidetobottomscreenwidth+"px) {#html5box-html5-lightbox .html5-elem-wrap {width:100%;height:auto;} #html5box-html5-lightbox .html5-elem-data-box {width:100%;height:auto;min-height:0;}}"}else if(inst.options.titlestyle=="left"){styleCss+="#html5box-html5-lightbox .html5-elem-wrap {height:100%;} #html5box-html5-lightbox .html5-elem-data-box {width:"+ String(100-inst.options.imagepercentage)+"%;min-height:100%;}";styleCss+="@media (max-width: "+inst.options.sidetobottomscreenwidth+"px) {#html5box-html5-lightbox .html5-elem-wrap {width:100%;height:auto;} #html5box-html5-lightbox .html5-elem-data-box {width:100%;height:auto;min-height:0;}}"}styleCss+=".html5-rotate { border-radius:50%; -webkit-transition:-webkit-transform .4s ease-in; transition: transform .4s ease-in; } .html5-rotate:hover { -webkit-transform: rotate(360deg); transform: rotate(360deg); }"; styleCss+="@media (max-width: "+inst.options.navarrowsbottomscreenwidth+"px) {#html5-social {"+inst.options.socialpositionsmallscreen+"}}";if(inst.options.exitanimationduration)inst.options.animationduration=inst.options.exitanimationduration;styleCss+=".html5box-animated { -webkit-animation-duration:"+inst.options.animationduration+"; animation-duration:"+inst.options.animationduration+"; -webkit-animation-fill-mode: both; animation-fill-mode: both; }";styleCss+="@-webkit-keyframes html5box-fadeOut { from { opacity: 1; } to { opacity: 0; } } @keyframes html5box-fadeOut { from { opacity: 1; } to { opacity: 0; } } .html5box-fadeOut { -webkit-animation-name: html5box-fadeOut; animation-name: html5box-fadeOut; }"; styleCss+="@-webkit-keyframes html5box-fadeOutDown { from { opacity: 1; } to { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } @keyframes html5box-fadeOutDown { from { opacity: 1; } to { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } .html5box-fadeOutDown { -webkit-animation-name: html5box-fadeOutDown; animation-name: html5box-fadeOutDown; }";styleCss+=".html5box-enter-animated { -webkit-animation-duration:"+ inst.options.enteranimationduration+"; animation-duration:"+inst.options.enteranimationduration+"; -webkit-animation-fill-mode: both; animation-fill-mode: both; }";styleCss+=" @keyframes html5box-none { } .html5box-none { animation-name: html5box-none; }";styleCss+=" @keyframes html5box-fadeIn { from { opacity: 0; } to { opacity: 1; } } .html5box-fadeIn { animation-name: html5box-fadeIn; }";styleCss+=" @keyframes html5box-fadeInDown { from { opacity: 0; transform: translate3d(0, -100%, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } } .html5box-fadeInDown { animation-name: html5box-fadeInDown; }"; styleCss+=" @keyframes html5box-zoomIn { from { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 50% { opacity: 1; } } .html5box-zoomIn { animation-name: html5box-zoomIn; }";styleCss+=" @keyframes html5box-bounceIn { from, 20%, 40%, 60%, 80%, to { animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } 0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 20% { transform: scale3d(1.1, 1.1, 1.1); } 40% { transform: scale3d(0.9, 0.9, 0.9); } 60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); } 80% { transform: scale3d(0.97, 0.97, 0.97); } to { opacity: 1; transform: scale3d(1, 1, 1); } } .html5box-bounceIn { animation-name: html5box-bounceIn; }"; styleCss+=" #html5-close .mh-icon-close { font-size: 14px; padding: 4px; color: #333; background-color: #fff; } #html5-close .mh-icon-close:hover { color: #000; }";styleCss+=" #html5-close-fullscreen .mh-icon-close { font-size: 24px; padding: 4px; color: #eee; background-color: rgba(0,0,0,0.7); } #html5-close-fullscreen .mh-icon-close:hover { color: #fff; }";styleCss+=" .html5-nav-showcontrol .mh-icon-th-thumb { color: #ddd; font-size: 16px; } .html5-nav-showcontrol .mh-icon-th-thumb:hover { color: #fff; }"; $("head").append("");var elemheight=inst.options.elemautoheight?"auto":"100%";inst.$lightbox=$("");inst.options.positionFixed=inst.options.supportCSSPositionFixed&&inst.options.responsive&&!inst.options.iequirksmode; if(inst.options.useabsolutepos||inst.options.useabsoluteposonmobile&&inst.options.isMobile)inst.options.positionFixed=false;inst.$lightbox.css({position:inst.options.positionFixed?"fixed":"absolute"});inst.$lightbox.appendTo("body");inst.$lightboxBox=$("#html5-lightbox-box",inst.$lightbox);inst.$elem=$(".html5-elem-box",inst.$lightbox);inst.$elemWrap=$(".html5-elem-wrap",inst.$lightbox);inst.$loading=$(".html5-loading",inst.$lightbox);inst.$error=$(".html5-error-box",inst.$lightbox);inst.$image=$(".html5-image", inst.$lightbox);if(inst.options.loadingusefont){inst.$loading.css({"top":"50%","left":"50%",transform:"translate(-50%, -50%)","font-size":"24px","line-height":"44px",padding:"10px",color:inst.options.loadingfontcolor,"background-color":inst.options.loadingfontbg});inst.$loading.append('
')}else inst.$loading.css({top:"0",left:"0",width:"100%",height:"100%",background:'url("'+inst.options.loadingimage+'") no-repeat center center'}); if(inst.options.fullscreenmode&&inst.options.fullscreennomargin)inst.$elem.css({overflow:"hidden"});var elemText="";if(inst.options.titlestyle=="left")inst.$elem.prepend(elemText);else if(inst.options.titlestyle=="outside")inst.$lightbox.append(elemText);else inst.$elem.append(elemText);inst.$elemData=$(".html5-elem-data-box",inst.$lightbox);inst.$text= $(".html5-text",inst.$lightbox);if(inst.options.borderradius>0){inst.$elem.css({"border-radius":inst.options.borderradius+"px","-moz-border-radius":inst.options.borderradius+"px","-webkit-border-radius":inst.options.borderradius+"px"});if(inst.options.titlestyle=="inside")inst.$elemWrap.css({"border-radius":inst.options.borderradius+"px","-moz-border-radius":inst.options.borderradius+"px","-webkit-border-radius":inst.options.borderradius+"px"});else if(inst.options.titlestyle=="bottom"){inst.$elemWrap.css({"border-top-left-radius":inst.options.borderradius+ "px","-moz-top-left-border-radius":inst.options.borderradius+"px","-webkit-top-left-border-radius":inst.options.borderradius+"px","border-top-right-radius":inst.options.borderradius+"px","-moz-top-right-border-radius":inst.options.borderradius+"px","-webkit-top-right-border-radius":inst.options.borderradius+"px"});inst.$elemData.css({"border-bottom-left-radius":inst.options.borderradius+"px","-moz-top-bottom-border-radius":inst.options.borderradius+"px","-webkit-bottom-left-border-radius":inst.options.borderradius+ "px","border-bottom-right-radius":inst.options.borderradius+"px","-moz-bottom-right-border-radius":inst.options.borderradius+"px","-webkit-bottom-right-border-radius":inst.options.borderradius+"px"})}}if(inst.options.titlestyle=="right"||inst.options.titlestyle=="left"){inst.$lightboxBox.css({"background-color":inst.options.bgcolor});if(inst.options.titlestyle=="right"){inst.$elemWrap.css({position:"relative","float":"left"});inst.$elemData.css({position:"relative",overflow:"hidden",padding:inst.options.bordersize+ "px"})}else{inst.$elemWrap.css({position:"relative",overflow:"hidden"});inst.$elemData.css({position:"relative","float":"left",padding:inst.options.bordersize+"px"})}}else if(inst.options.titlestyle=="inside"){inst.$elemData.css({position:"absolute",margin:0,padding:0,bottom:inst.options.bordersize+"px",left:inst.options.bordersize+"px",right:inst.options.bordersize+"px","background-color":"#333","background-color":"rgba(51, 51, 51, 0.6)"});if(inst.options.showonmouseoverinside)inst.$elemData.css({opacity:0}); inst.$text.css({padding:inst.options.bordersize+"px "+2*inst.options.bordersize+"px"})}else if(inst.options.titlestyle=="outside")inst.$elemData.css({position:"relative",width:"100%",height:"auto"});else{inst.$elemData.css({position:"relative",width:"100%",height:inst.options.barautoheight?"auto":inst.options.barheight+"px","padding":"0 0 "+inst.options.bordersize+"px"+" 0","background-color":inst.options.bgcolor,"text-align":"left"});if(!inst.options.fullscreenmode||!inst.options.fullscreennomargin)inst.$text.css({"margin":"0 "+ inst.options.bordersize+"px"})}if(inst.options.isTouch&&inst.options.navarrowsalwaysshowontouch&&inst.options.navarrowspos=="inside")inst.options.navarrowspos="side";inst.$lightboxBox.append("
");inst.$next=$(".html5-next",inst.$lightbox);inst.$prev=$(".html5-prev",inst.$lightbox);if(inst.options.fullscreenmode||inst.options.navarrowspos=="browserside"){inst.$lightbox.append("
"); inst.$nextfullscreen=$(".html5-next-fullscreen",inst.$lightbox);inst.$prevfullscreen=$(".html5-prev-fullscreen",inst.$lightbox);inst.$next.addClass("html5-next-outside");inst.$prev.addClass("html5-prev-outside")}else{inst.$next.addClass(inst.options.navarrowspos=="side"?"html5-next-outside":"html5-next-inside");inst.$prev.addClass(inst.options.navarrowspos=="side"?"html5-prev-outside":"html5-prev-inside");if(inst.options.navarrowspos=="side"||inst.options.alwaysshownavarrows){inst.$next.css({display:"block"}); inst.$prev.css({display:"block"})}}if(inst.options.arrowsusefont){inst.$next.append('
');inst.$prev.append('
');if(inst.$nextfullscreen){inst.$nextfullscreen.append('
');inst.$prevfullscreen.append('
')}}else{inst.$next.append("");inst.$prev.append("");if(inst.$nextfullscreen){inst.$nextfullscreen.append("");inst.$prevfullscreen.append("")}}if(inst.options.fullscreenmode||inst.options.closepos=="topright"){inst.$lightbox.append("");inst.$close=$("#html5-close-fullscreen",inst.$lightbox)}else{inst.$lightboxBox.append("");inst.$close=$("#html5-close",inst.$lightbox)}if(inst.options.closeusefont&&(inst.options.fullscreenmode||inst.options.closepos=="topright"||inst.options.closepos=="inside"))inst.$close.append('
');else inst.$close.append("");if(inst.options.titlestyle=="inside"&&inst.options.showonmouseoverinside)inst.$lightboxBox.hover(function(){if(inst.currentElem[ELEM_TYPE]==0||!inst.options.showinsidetitleforimageonly)inst.$elemData.animate({opacity:1},400)},function(){inst.$elemData.animate({opacity:0},400)});inst.$watermark=$("#html5-watermark",inst.$lightbox);if(inst.options.stamp)inst.$watermark.html("
"+ inst.options.freemark+"
");else if(inst.options.watermark){var html="";if(inst.options.watermarklink)html=""+html+"";inst.$watermark.html(html)}if(inst.options.closeonoverlay)$("#html5-lightbox-overlay",inst.$lightbox).click(inst.finish);inst.$close.click(inst.finish);inst.$next.click(function(){inst.nextArrowClicked()});inst.$prev.click(function(){inst.prevArrowClicked()}); if(inst.$nextfullscreen){inst.$nextfullscreen.click(function(){inst.nextArrowClicked()});inst.$prevfullscreen.click(function(){inst.prevArrowClicked()})}$(window).resize(function(){if(inst.options.isIOS&&!inst.options.mobileresizeevent)return;clearTimeout(inst.options.resizeTimeout);inst.options.resizeTimeout=setTimeout(function(){inst.resizeWindow()},inst.options.resizedelay)});$(window).scroll(function(){if(inst.options.isIOS&&!inst.options.mobileresizeevent)return;inst.scrollBox()});$(window).on("orientationchange", function(e){if(inst.options.isMobile){clearTimeout(inst.options.resizeTimeout);inst.options.resizeTimeout=setTimeout(function(){inst.resizeWindow()},inst.options.resizedelay)}});if(inst.options.enabletouchswipe)inst.enableSwipe()};inst.showSocialButtons=function(){if(inst.options.showsocial){if($("#html5-social").length>0)$("#html5-social").remove();var socialCode='';inst.$lightboxBox.append(socialCode);$(".html5-social-btn-action",inst.$lightbox).click(function(){var shareUrl=inst.options.sharemediaurl?inst.currentElem[ELEM_HREF]:window.location.href+(window.location.href.indexOf("?")<0?"?":"&")+"wplightboxshare="+encodeURIComponent(inst.currentElem[ELEM_HREF]);var shareTitle=inst.currentElem[ELEM_TITLE];var shareMedia= inst.currentElem[ELEM_HREF];if(inst.currentElem[ELEM_TYPE]==0)shareMedia=inst.absoluteUrl(inst.currentElem[ELEM_HREF]);else if(inst.currentElem[ELEM_TYPE]==3)shareMedia="https://img.youtube.com/vi/"+inst.getYoutubeId(inst.currentElem[ELEM_HREF])+"/0.jpg";else{var lightboxLink=$('.wplightbox[href="'+inst.currentElem[ELEM_HREF]+'"]');if(lightboxLink.length>0)if(lightboxLink.data("shareimage")&&lightboxLink.data("shareimage").length>0)shareMedia=inst.absoluteUrl(lightboxLink.data("shareimage"));else if(lightboxLink.data("thumbnail")&& lightboxLink.data("thumbnail").length>0)shareMedia=inst.absoluteUrl(lightboxLink.data("thumbnail"));else{var lightboxImg=$("img",lightboxLink);if(lightboxImg.length>0)shareMedia=inst.absoluteUrl(lightboxImg.attr("src"))}}var isVideo=inst.currentElem[ELEM_TYPE]==2||inst.currentElem[ELEM_TYPE]==3||inst.currentElem[ELEM_TYPE]==4||inst.currentElem[ELEM_TYPE]==8||inst.currentElem[ELEM_TYPE]==9||inst.currentElem[ELEM_TYPE]==11||inst.currentElem[ELEM_TYPE]==12;if(!shareTitle)shareTitle=inst.options.sharetextprefix; else shareTitle=inst.html2Text(shareTitle);if($(this).hasClass("html5-social-facebook"))window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(shareUrl)+"&t="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-twitter"))window.open("https://twitter.com/share?url="+encodeURIComponent(shareUrl)+"&text="+encodeURIComponent(shareTitle),"_blank");else if($(this).hasClass("html5-social-pinterest"))window.open("https://pinterest.com/pin/create/bookmarklet/?media="+ encodeURIComponent(shareMedia)+"&url="+encodeURIComponent(shareUrl)+"&description="+encodeURIComponent(shareTitle)+"&is_video="+(isVideo?"true":"false"),"_blank");else if($(this).hasClass("html5-social-email"))window.open("mailto:?subject="+encodeURIComponent(shareTitle)+"&body="+encodeURIComponent(inst.options.sharetextprefix+" "+shareUrl));return false})}};inst.html2Text=function(html){var tag=document.createElement("div");tag.innerHTML=html;return tag.innerText};inst.slideTimer=function(interval, callback,updatecallback){var timerInstance=this;timerInstance.timeout=interval;var updateinterval=50;var updateTimerId=null;var runningTime=0;var paused=false;var started=false;var startedandpaused=false;this.pause=function(){if(started){paused=true;clearInterval(updateTimerId)}};this.resume=function(forceresume){if(startedandpaused&&!forceresume)return;startedandpaused=false;if(started&&paused){paused=false;updateTimerId=setInterval(function(){runningTime+=updateinterval;if(runningTime>timerInstance.timeout){clearInterval(updateTimerId); if(callback)callback()}if(updatecallback)updatecallback(runningTime/timerInstance.timeout)},updateinterval)}};this.stop=function(){clearInterval(updateTimerId);if(updatecallback)updatecallback(-1);runningTime=0;paused=false;started=false};this.start=function(){runningTime=0;paused=false;started=true;updateTimerId=setInterval(function(){runningTime+=updateinterval;if(runningTime>timerInstance.timeout){clearInterval(updateTimerId);if(callback)callback()}if(updatecallback)updatecallback(runningTime/ timerInstance.timeout)},updateinterval)};this.startandpause=function(){runningTime=0;paused=true;started=true;startedandpaused=true};return this};inst.updateTimer=function(percent){var w=Math.round(percent*100);if(w>100)w=100;if(w<0)w=0;$(".html5-timer",inst.$lightbox).css({display:"block",width:w+"%"})};inst.initSlide=function(){inst.autosliding=false;inst.slideTimeout=inst.slideTimer(inst.options.slideinterval,function(){inst.gotoSlide(-1)},inst.options.showtimer?function(percent){inst.updateTimer(percent)}: null);if(inst.options.autoslide){inst.slideTimeout.stop();inst.autosliding=true}};inst.nextArrowClicked=function(){if(inst.options.nextElem<=inst.options.curElem)if(inst.options.onlastarrowclicked&&window[inst.options.onlastarrowclicked]&&typeof window[inst.options.onlastarrowclicked]=="function")window[inst.options.onlastarrowclicked]();inst.gotoSlide(-1)};inst.prevArrowClicked=function(){if(inst.options.prevElem>=inst.options.curElem)if(inst.options.onfirstarrowclicked&&window[inst.options.onfirstarrowclicked]&& typeof window[inst.options.onfirstarrowclicked]=="function")window[inst.options.onfirstarrowclicked]();inst.gotoSlide(-2)};inst.calcNextPrevElem=function(){inst.options.nextElem=-1;inst.options.prevElem=-1;inst.options.inGroup=false;inst.options.groupIndex=0;inst.options.groupCount=0;if(inst.elemArray.length<=1)return;var group=inst.elemArray[inst.options.curElem][ELEM_GROUP];for(var i=0;iinst.elemArray.length-1)inst.options.nextElem=0;inst.options.prevElem=inst.options.curElem-1;if(inst.options.prevElem<0)inst.options.prevElem=inst.elemArray.length-1}else{var j,curGroup=inst.elemArray[inst.options.curElem][ELEM_GROUP];if(curGroup!=undefined&&curGroup!=null){for(j=inst.options.curElem+1;j=0){for(j=inst.options.curElem-1;j>=0;j--)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.prevElem=j;break}if(inst.options.prevElem<0)for(j=inst.elemArray.length-1;j>inst.options.curElem;j--)if(inst.matchGroup(curGroup,inst.elemArray[j][ELEM_GROUP])){inst.options.prevElem= j;break}}}}if(inst.options.nextElem>=0||inst.options.prevElem>=0)inst.options.inGroup=true};inst.calcBoxPosition=function(initW,initH){var boxW=initW+2*inst.options.bordersize;var boxH=initH+2*inst.options.bordersize;var navH=inst.options.shownavigation&&inst.navvisible?inst.options.navheight:0;var winH=inst.getWinH();var boxT=Math.round((winH-navH)/2-boxH/2);if(inst.options.titlestyle=="bottom")boxT-=Math.round(inst.options.barheight/2);var topmargin=$(window).height()0?inst.options.iframetopmargin:topmargin;if(inst.options.iframesamedomain&&parent.window.jQuery&&parent.window.jQuery("#"+inst.options.iframeid).length){var iframetop=parent.window.jQuery("#"+inst.options.iframeid).offset().top;var parentscroll=parent.window.document.body.scrollTop;boxT+=parentscroll>iframetop?parentscroll- iframetop:0}}return[boxW,boxH,boxT]};inst.hideNavArrows=function(){var showPrev=false;var showNext=false;if(inst.options.inGroup){if(inst.options.arrowloop||!inst.options.arrowloop&&inst.options.prevEleminst.options.curElem)showNext=true}if(!showPrev){inst.$prev.css({display:"none"});if(inst.$prevfullscreen)inst.$prevfullscreen.css({display:"none"})}if(!showNext){inst.$next.css({display:"none"}); if(inst.$nextfullscreen)inst.$nextfullscreen.css({display:"none"})}};inst.resizePositionFixed=function(){if(!inst.options.positionFixed)inst.$lightbox.css({"padding-top":$(window).scrollTop()+"px","height":Math.max($(document).height(),$(window).height())+"px"})};inst.adjustLightboxPos=function(w,h){var winWidth=$(window).width();var boxPos=inst.calcBoxPosition(w,h);var boxW=boxPos[0];var boxH=boxPos[1];var boxT=boxPos[2];if(inst.options.iequirksmode)inst.$lightboxBox.css({"top":boxT});else inst.$lightboxBox.css({"margin-top":boxT}); inst.resizePositionFixed();if((inst.options.titlestyle=="left"||inst.options.titlestyle=="right")&&winWidth>inst.options.sidetobottomscreenwidth){inst.$lightboxBox.css({"width":boxW,"height":boxH});inst.$elemWrap.css({"width":inst.options.imagepercentage+"%","height":"100%"})}else{inst.$lightboxBox.css({"width":boxW,"height":"auto"});inst.$elemWrap.css({"width":boxW,"height":boxH})}};inst.readClassOptions=function(element){var classoptions={};var classList=$(element).attr("class");if(classList){classList= classList.split(/\s+/);$.each(classList,function(index,className){if(className&&className.toLowerCase().indexOf("wplightbox-")==0){var names=className.split("-");if(names.length==3&&names[2]){var val=names[2];if(val.toLowerCase()=="true")val=true;else if(val.toLowerCase()=="false")val=false;else if(/^\d+$/.test(val))val=parseInt(val);else if(!isNaN(val))val=parseFloat(val);classoptions[names[1]]=val}}})}return classoptions};inst.clickHandler=function(){var $this=$(this);var dataoptions={};$.each($this.data(), function(key,value){dataoptions[key.toLowerCase()]=value});inst.options=$.extend(inst.options,inst.defaultoptions,dataoptions);var classoptions=inst.readClassOptions(this);inst.options=$.extend(inst.options,classoptions);$(window).trigger("html5lightbox.lightboxshow");inst.init();if(inst.elemArray.length<=0)return true;inst.hideObjects();for(var i=0;i';inst.$lightboxBox.append(audioCode); if(inst.options.fullscreenmode||inst.options.closepos=="topright")inst.$lightbox.append('
');else{inst.$lightboxBox.append('
');if(inst.options.audioshowonhover){inst.$lightboxBox.on("mouseenter mousemove",function(){$(".html5-audio-button",inst.$lightbox).fadeIn()});inst.$lightboxBox.on("mouseleave",function(){$(".html5-audio-button",inst.$lightbox).fadeOut()})}}$(".html5-audio-volume",inst.$lightbox).click(function(){var audio=$("audio",inst.$lightbox);if(audio.get(0).paused){audio.get(0).play();$(this).removeClass("mh-icon-volume-off").addClass("mh-icon-volume-up")}else{audio.get(0).pause();$(this).removeClass("mh-icon-volume-up").addClass("mh-icon-volume-off")}})}; inst.loadThumbnail=function(src,index,title){var imgLoader=new Image;$(imgLoader).on("load",function(){var style;if(this.width/this.height<=inst.options.thumbwidth/inst.options.thumbheight)style="width:100%;";else style="height:100%;";$(".html5-nav-thumb").eq(index).html(""+inst.html2Text(title)+"")});imgLoader.src=src};inst.matchGroup=function(curGroup,elemGroup){if(inst.options.showall)return true;if(!curGroup||!elemGroup)return false;var curs=curGroup.split(":"); var elems=elemGroup.split(":");var result=false;for(var i in curs)if($.inArray(curs[i],elems)>-1){result=true;break}return result};inst.getWinH=function(){return inst.options.insideiframe&&window.self!=window.top&&inst.options.iframesamedomain?$(parent.window).height():$(window).height()};inst.showNavigation=function(){if(!inst.options.shownavigation)return;if((inst.options.isIPhone||inst.options.isAndroid)&&inst.options.hidenavigationonmobile||inst.options.isIPad&&inst.options.hidenavigationonipad)return; if(!inst.currentElem||!inst.currentElem[ELEM_GROUP]&&!inst.options.showall)return;var i;var showNav=false;var group=inst.currentElem[ELEM_GROUP];for(i=0;i0){showNav=true;break}if(!showNav)return;inst.options.navheight=inst.options.thumbheight+inst.options.thumbtopmargin+inst.options.thumbbottommargin;if($(".html5-nav").length>0)return;var posCss= inst.options.hidenavdefault?"top:100%;bottom:auto;left:0;right:0;":"top:auto;bottom:0;left:0;right:0;";var posType=inst.options.positionFixed?"fixed":"absolute";$("body").append("
"+"
"+"
"+"
"+"
"+"
"+"
"+"
"+"
");inst.navvisible=inst.options.hidenavdefault?false:true;if(inst.options.shownavcontrol){$(".html5-nav").append('
');if(inst.options.navusefont)$(".html5-nav-showcontrol").append('
'); else $(".html5-nav-showcontrol").append('');$(".html5-nav-showcontrol").click(function(){var winH=inst.getWinH();var navH=$(".html5-nav").height();if(inst.navvisible){inst.navvisible=false;$(".html5-nav").css({top:winH-navH+"px",bottom:"auto"}).animate({top:winH+"px"},function(){$(this).css({top:"100%",bottom:"auto"})})}else{inst.navvisible=true;var navH=$(".html5-nav").height();$(".html5-nav").css({top:winH+"px",bottom:"auto"}).animate({top:winH- navH+"px"},function(){$(this).css({top:"auto",bottom:0})})}inst.resizeWindow()})}var index=0;for(i=0;i0){$(".html5-nav-list").append("
");this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL],index,inst.elemArray[i][ELEM_TITLE]);index++}$(".html5-nav-thumb").hover(function(){$(this).css({opacity:1});$(this).css({border:inst.options.thumbborder+"px solid "+inst.options.thumbhighlightbordercolor})},function(){$(this).css({opacity:inst.options.thumbopacity});$(this).css({border:inst.options.thumbborder+"px solid "+ inst.options.thumbbordercolor})});$(".html5-nav-thumb").click(function(){var index=$(this).data("arrayindex");if(index>=0)inst.gotoSlide(index)});inst.options.totalwidth=index*(inst.options.thumbgap+inst.options.thumbwidth+2*inst.options.thumbborder);$(".html5-nav-list").css({display:"block",position:"relative","margin-left":0,width:inst.options.totalwidth+"px"}).append("
");var $navMask=$(".html5-nav-mask");var $navPrev=$(".html5-nav-prev");var $navNext=$(".html5-nav-next"); $navPrev.click(function(){var $navList=$(".html5-nav-list");var $navNext=$(".html5-nav-next");var winWidth=$(window).width();var maskWidth=winWidth-2*inst.options.navbuttonwidth;var marginLeft=parseInt($navList.css("margin-left"))+maskWidth;if(marginLeft>=0){marginLeft=0;$(this).css({"background-position":"center left"})}else $(this).css({"background-position":"center right"});if(marginLeft<=maskWidth-inst.options.totalwidth)$navNext.css({"background-position":"center left"});else $navNext.css({"background-position":"center right"}); $navList.animate({"margin-left":marginLeft})});$navNext.click(function(){var $navList=$(".html5-nav-list");var $navPrev=$(".html5-nav-prev");var winWidth=$(window).width();var maskWidth=winWidth-2*inst.options.navbuttonwidth;var marginLeft=parseInt($navList.css("margin-left"))-maskWidth;if(marginLeft<=maskWidth-inst.options.totalwidth){marginLeft=maskWidth-inst.options.totalwidth;$(this).css({"background-position":"center left"})}else $(this).css({"background-position":"center right"});if(marginLeft>= 0)$navPrev.css({"background-position":"center left"});else $navPrev.css({"background-position":"center right"});$navList.animate({"margin-left":marginLeft})});var winWidth=$(window).width();if(inst.options.totalwidth<=winWidth){$navMask.css({width:inst.options.totalwidth+"px"});$navPrev.hide();$navNext.hide()}else{$navMask.css({width:winWidth-2*inst.options.navbuttonwidth+"px"});$navPrev.show();$navNext.show()}};inst.loadElem=function(elem){inst.currentElem=elem;inst.showing=true;if(inst.options.bodynoscroll)$("html,body").addClass("bodynoscroll"); if(!(inst.options.showtitle&&inst.currentElem[ELEM_TITLE]&&inst.currentElem[ELEM_TITLE].length>0||inst.options.showdescription&&inst.currentElem[ELEM_DESCRIPTION]&&inst.currentElem[ELEM_DESCRIPTION].length>0||inst.options.inGroup&&(inst.options.showplaybutton||inst.options.showtitleprefix)))inst.options.barheight=0;inst.showSocialButtons();inst.showNavigation();inst.$elem.off("mouseenter").off("mouseleave").off("mousemove");inst.$loading.show();if(inst.options.onshowitem&&window[inst.options.onshowitem]&& typeof window[inst.options.onshowitem]=="function")window[inst.options.onshowitem](elem);if((inst.options.transition=="slide"||inst.options.transition=="crossfade")&&inst.existingElem>=0){$(".html5-elem-box-previous").remove();var newitem=inst.$elem.clone();newitem.insertAfter(inst.$elem);inst.$prevelem=inst.$elem;inst.$elem=newitem;inst.$prevelem.addClass("html5-elem-box-previous");inst.$elem.addClass("html5-elem-box-current");inst.$elemWrap=$(".html5-elem-wrap",inst.$elem);inst.$loading=$(".html5-loading", inst.$elem);inst.$error=$(".html5-error-box",inst.$elem);inst.$image=$(".html5-image",inst.$elem);if(inst.options.titlestyle!="outside"){inst.$elemData=$(".html5-elem-data-box",inst.$elem);inst.$text=$(".html5-text",inst.$elem)}inst.$elem.css({position:"absolute",top:0,left:inst.options.transition=="slide"?inst.direction==-1?"100%":"-100%":0,opacity:0,height:"auto"});inst.$prevelem.css({width:inst.$prevelem.width()+"px",height:inst.$prevelem.height()+"px"});if(inst.options.transition=="crossfade"){inst.$prevelem.css({margin:0, left:"50%",transform:"translateX(-50%)"});$(".html5-prev-inside, .html5-next-inside, .html5-prev-outside, .html5-next-outside",inst.$lightbox).css({visibility:"hidden"})}}switch(elem[ELEM_TYPE]){case 0:var imgLoader=new Image;$(imgLoader).on("load",function(){elem[ELEM_ORIGINALWIDTH]=imgLoader.width;elem[ELEM_ORIGINALHEIGHT]=imgLoader.height;inst.showImage(elem,imgLoader.width,imgLoader.height)});$(imgLoader).on("error",function(){inst.showError()});imgLoader.src=elem[ELEM_HREF];break;case 1:inst.showSWF(elem); break;case 2:case 8:inst.showVideo(elem);break;case 3:case 4:case 9:case 11:case 12:inst.showYoutubeVimeo(elem);break;case 5:inst.showPDF(elem);break;case 6:inst.showMP3(elem);break;case 7:inst.showWeb(elem,false);break;case 10:inst.showDiv(elem);break}if(inst.options.pushwindowhistory&&window.history&&window.history.pushState){var historyURL=window.location.pathname+window.location.search+"#html5lightbox_"+encodeURIComponent(elem[ELEM_HREF]);window.history.pushState({},"",historyURL);window.onhashchange= function(){if(!window.location.hash||window.location.hash.indexOf("#html5lightbox_")<0)inst.finish()}}if(inst.options.googleanalyticsaccount&&window._gaq)window._gaq.push(["_trackEvent","Lightbox","Open",elem[ELEM_HREF]]);if(inst.options.preload){if(inst.options.nextElem>=0&&inst.elemArray[inst.options.nextElem][ELEM_TYPE]==0)(new Image).src=inst.elemArray[inst.options.nextElem][ELEM_HREF];if(inst.options.prevElem>=0&&inst.elemArray[inst.options.prevElem][ELEM_TYPE]==0)(new Image).src=inst.elemArray[inst.options.prevElem][ELEM_HREF]}}; inst.loadCurElem=function(){inst.loadElem(inst.elemArray[inst.options.curElem])};inst.showError=function(){inst.$loading.hide();inst.resizeLightbox(inst.options.errorwidth,inst.options.errorheight,true,function(){inst.$loading.hide();inst.$error.show();inst.$elem.fadeIn(inst.options.fadespeed,function(){inst.showData()})})};inst.calcTextWidth=function(objW){return objW-36};inst.showTitle=function(t,description){var text="";if(inst.options.showtitle)if(t&&t.length>0)text+=t;if(inst.options.inGroup){if(inst.options.showtitleprefix)text= ""+inst.options.titleprefix.replace("%NUM",inst.options.groupIndex+1).replace("%TOTAL",inst.options.groupCount)+" "+text+"";if(inst.options.showplaybutton)text="
"+text}if(text.length>0)text='
'+text+"
";if(inst.options.showdescription&&description&&description.length>0)text+='
'+description+"
";inst.$text.html(text);if(inst.options.inGroup&&inst.options.showplaybutton){if(inst.autosliding){$(".html5-play",inst.$lightbox).hide();$(".html5-pause",inst.$lightbox).show()}else{$(".html5-play", inst.$lightbox).show();$(".html5-pause",inst.$lightbox).hide()}$(".html5-play",inst.$lightbox).click(function(){$(".html5-play",inst.$lightbox).hide();$(".html5-pause",inst.$lightbox).show();if(inst.slideTimeout){inst.slideTimeout.stop();inst.slideTimeout.start();inst.autosliding=true}});$(".html5-pause",inst.$lightbox).click(function(){$(".html5-play",inst.$lightbox).show();$(".html5-pause",inst.$lightbox).hide();if(inst.slideTimeout){inst.slideTimeout.stop();inst.autosliding=false}})}$("#html5-social", inst.$lightbox).show();if(inst.options.showsocialmedia)if(inst.currentElem[ELEM_SOCIALMEDIA])if($("#html5-socialmedia",inst.$lightboxBox).length>0)$("#html5-socialmedia",inst.$lightboxBox).html(inst.currentElem[ELEM_SOCIALMEDIA]);else inst.$lightboxBox.append('
'+inst.currentElem[ELEM_SOCIALMEDIA]+"
");else if($("#html5-socialmedia",inst.$lightboxBox).length>0)$("#html5-socialmedia",inst.$lightboxBox).remove()},inst.getElemSize= function(elem,initW,initH){var elemW,elemH;if(!elem[ELEM_MEDIUMWIDTH])elem[ELEM_MEDIUMWIDTH]=elem[ELEM_WIDTH];if(!elem[ELEM_SMALLWIDTH])elem[ELEM_SMALLWIDTH]=elem[ELEM_MEDIUMWIDTH];if(!elem[ELEM_MEDIUMHEIGHT])elem[ELEM_MEDIUMHEIGHT]=elem[ELEM_HEIGHT];if(!elem[ELEM_SMALLHEIGHT])elem[ELEM_SMALLHEIGHT]=elem[ELEM_MEDIUMHEIGHT];var wIndex=ELEM_WIDTH;var hIndex=ELEM_HEIGHT;var winWidth=$(window).width();if(winWidth